home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / programr / cat_exe.zip / TRIANGLE.CAR < prev    next >
Text File  |  1994-11-17  |  998b  |  52 lines

  1. (* program creates triangels *)
  2.  
  3. RECIPE  XYSize  =  40;
  4.         XYBound =  1;
  5.         Colors =  2;
  6.         Zet    = 2;
  7.  
  8. CONST Dead    =  0;
  9.       Alive   =  1;
  10. VAR x;
  11.  
  12. REF   right          [1,0];
  13.       left           [-1,0];
  14.       top            [0,-1];
  15.       bottom         [0,1];
  16.       bottom_right   [1,1];
  17.       bottom_left    [-1,1];
  18.       top_right      [1,-1];
  19.       top_left       [-1,-1];
  20.  
  21. EVENT SetUp;
  22.    RingForm;
  23.    PlClipAll;
  24.    RGBPalette(Colors, $0, $FF, $32,0, $B6,0);
  25.    ShowPlane;
  26.  
  27.  
  28. EVENT E1;(* initialization of the plane *)
  29.      PlClipActive;
  30.      WinClipAll;
  31.      PARALLEL DO
  32.        x := Random (1000);
  33.        IF  (x > 995)
  34.            THEN Self := Alive;
  35.            ELSE Self := Dead;
  36.        FI;
  37.      OD;
  38.      ShowPlane;
  39.  
  40. EVENT E2;
  41.     PlClipActive;
  42.     PARALLEL DO
  43.        IF  (right = Alive) OR
  44.            (left  = Alive) OR
  45.            (bottom   = Alive)
  46.            THEN Self := Alive
  47.        FI;
  48.     OD;
  49.     ShowPlane;
  50. END.
  51.  
  52.